<!DOCTYPE html>
<html>
<head>
    <title>商品列表</title>
    <#include "../common.ftl">
</head>
<body class="childrenBody">
<form class="layui-form" >
    <blockquote class="layui-elem-quote quoteBox">
        <form class="layui-form">
            <div class="layui-inline">
<#--             标题   -->
                <div class="layui-input-inline">
                    <input type="text" name="title" class="layui-input searchVal" placeholder="请输入标题" />
                </div>
<#--                商品编号-->
                <div class="layui-input-inline">
                    <input type="text" name="serial" id="serial" class="layui-input searchVal" placeholder="请输入商品编号" />
                </div>
<#--                商品状态-->
                <div class="layui-input-inline">
                    <select name="state" id="state">
                        <option value="">请选择商品状态</option>
                        <option value="1">售出中</option>
                        <option value="2">售罄</option>
                        <option value="3">下架</option>
                        <option value="4">用户已删除</option>
                    </select>
                </div>
<#--                商品分类-->
                <div class="layui-input-inline">
                    <select name="categoryId" id="categoryId" lay-verify="required" style="width:270px;">
                        <option value="1">全部</option>
                        <option value="2">生活</option>
                        <option value="3">服装</option>
                        <option value="4">食品</option>
                        <option value="5">数码</option>
                        <option value="6">书籍</option>
                        <option value="7">电器</option>
                        <option value="8">家具</option>
                        <option value="2">美妆</option>
                    </select>
                </div>
                <!-- 日期范围选择 -->
                <div class="layui-input-inline">
                    <input type="text" name="dateRange" id="dateRange" class="layui-input" placeholder="选择日期范围" style="width: 200px;">
                </div>
                <button type="button" class="layui-btn" id="searchBtn" data-type="reload" >搜索</button>
            </div>
        </form>
    </blockquote>

    <table id="list" class="layui-table"  lay-filter="list"></table>
<#--头部工具栏-->
    <script type="text/html" id="toolbarDemo">
        <div class="layui-btn-container">
            <a class="layui-btn layui-btn-normal addNews_btn" lay-event="add">
                <i class="layui-icon">&#xe608;</i>
                添加商品
            </a>
            <button class="layui-btn layui-btn-sm layui-btn-primary" lay-event="refresh"><i class="iconfont iconshuaxin"></i>&nbsp;刷新</button>
        </div>
    </script>

    <!--操作-->
    <script id="barInline" type="text/html">
        <a class="layui-btn layui-btn-xs" id="edit" lay-event="toCommodityDetail">详情</a>
        {{# if(d.state == 1 ){ }}
        <a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="del">下架</a>
        {{# } }}
    </script>

    <!-- 数据格式 -->
    <script type="text/html" id="categoryTpl">
        {{d.category.cateName}}
    </script>
    <script type="text/html" id="userTpl">
        {{d.user.userName}}
    </script>
    <script type="text/html" id="stateTpl">
        {{#  if(d.state == 1){ }}
        <button class="layui-btn layui-btn-xs layui-btn-normal">出售中</button>
        {{#  } else if(d.state == 2) { }}
        <button class="layui-btn layui-btn-xs layui-btn-primary">售罄</button>
        {{#  } else if(d.state == 3) { }}
        <button class="layui-btn layui-btn-xs layui-btn-warm">下架</button>
        {{#  } else if(d.state == 4) { }}
        <button class="layui-btn layui-btn-xs layui-btn-disabled">删除</button>
        {{# } }}
    </script>
</form>

<script type="text/javascript" src="${ctx}/js/commodity/commodity.js"></script>
</body>
</html>